package webjoch.wrappers;

import java.util.ArrayList;
/**
 * Tasks in the dungeon
 * @author Webjoch
 *
 */
public class Task {
	private Room room;
	private ArrayList<Integer> itemIds = new ArrayList<Integer>();
	
	public Task (Room room){
		this.room = room;
	}
	
	/**
	 * Set all item id`s that are needed for the task
	 * @param ids an int array of the needed item id`s
	 */
	public void setItems(int[] ids){
		for (int id : ids){
			itemIds.add(id);
		}
	}
	
	/**
	 * Get all needed items for the task
	 * @return an array of the needed items
	 */
	public int[] getNeededItems(){
		if (itemIds.size() == 0) return new int[] {0};
		int[] ret = new int[itemIds.size()];
	    for (int i=0; i < ret.length; i++){
	        ret[i] = itemIds.get(i).intValue();
	    }
		return ret;
	}
	
	/**
	 * Get the given room
	 * @return the room
	 */
	public Room getRoom(){
		return room;
	}
}